from django.db import migrations, models
import django.db.models.deletion
from django.conf import settings


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('user_app', '0005_alter_user_access_token_alter_user_company_and_more'),
        ('vehicle_app', '0003_vehicle_vehicle_image'),
    ]

    operations = [
        migrations.CreateModel(
            name='Review',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('type', models.CharField(choices=[('user', '用户资质审核'), ('vehicle', '车辆资质审核')], max_length=20, verbose_name='审核类型')),
                ('status', models.CharField(choices=[('pending', '待审核'), ('approved', '已通过'), ('rejected', '已拒绝')], default='pending', max_length=20, verbose_name='审核状态')),
                ('reason', models.TextField(blank=True, verbose_name='审核说明')),
                ('submitted_at', models.DateTimeField(auto_now_add=True, verbose_name='提交时间')),
                ('reviewed_at', models.DateTimeField(blank=True, null=True, verbose_name='审核时间')),
                ('reviewer', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='reviews', to=settings.AUTH_USER_MODEL, verbose_name='审核员')),
                ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='用户')),
                ('vehicle', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='vehicle_app.vehicle', verbose_name='车辆')),
            ],
            options={
                'verbose_name': '资质审核',
                'verbose_name_plural': '资质审核',
                'ordering': ['-submitted_at'],
            },
        ),
    ]